package com.example.dianchiwater;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;

public class Zhuce extends AppCompatActivity {
    Button btTj,btFh;

    TextView ZcCode,ZcXm,ZcNl,ZcMz,ZcDh,ZcDz,ZcXb;
    Spinner ZcZw;

    String Name,Age,Code,Sex,Work,Nation,Area,Phone;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhuce);
        btTj = findViewById(R.id.btTj);
        btFh = findViewById(R.id.btFh);

        ZcCode = findViewById(R.id.ZhuceCode);//注册工号
        ZcDh = findViewById(R.id.ZhucePhone);//注册电话
        ZcDz = findViewById(R.id.ZhuceDizhi);//注册地址
        ZcMz = findViewById(R.id.ZhuceMinzu);//注册民族
        ZcNl = findViewById(R.id.ZhuceAge);//年龄
        ZcXm = findViewById(R.id.ZhuceName);//姓名
        ZcXb = findViewById(R.id.ZhuceSex);//性别

        ZcZw = findViewById(R.id.spzhiwei);//职务

        //提交按钮
        btTj.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //将text view里的值赋值给string类
                Name = ZcXm.getText().toString();
                Age = ZcNl.getText().toString();
                Code = ZcCode.getText().toString();
                Sex = ZcXb.getText().toString();
                Nation = ZcMz.getText().toString();
                Area = ZcDz.getText().toString();
                Phone = ZcDh.getText().toString();

                //spinner赋值
                Work = ZcZw.getSelectedItem().toString();

                //数据库语句

            }
        });
        //返回按钮
        btFh.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}